<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>

<html>
	<head>
		<meta charset="utf-8" />
		<title>人事档案登记</title>
		<%@include file="common.jsp" %> 
		<!--时间  -->
		 <link href="${pageContext.request.contextPath }/static/css/laydate/theme/default/laydate.css" rel="stylesheet" type="text/css" />
		<!-- bootstrap-table -->

			  <link href="${pageContext.request.contextPath }/static/css/bootstrap.min.css" rel="stylesheet" type="text/css">
    <link href="${pageContext.request.contextPath }/static/css/bootstrap-table.css" rel="stylesheet" type="text/css">
     <link rel="stylesheet" href="${pageContext.request.contextPath }/static/css/base.css" />
    <link rel="stylesheet" href="${pageContext.request.contextPath }/static/css/info-mgt.css" />
 	<style>
		
			#file{
				height: 25px;
				width: 130px;
			}
			#add td{
			padding-top: 8px;
			
			}
			  #add select{
			/* 	margin-left: 20px; */
				 	margin-right: 50px; 
				width: 170px;
			} 
			#add input{
			width: 170px;
			}
			#tt{
				text-decoration :none;
				display: block;
				margin-left: 165px;
				margin-top: -20px;
				
			}
			body{
				font-size: 15px;
				
			}
			textarea{
				margin-left: 20px;
				
			}
			#pf_sex{
				width: 144px;
			}
			#add span{
				margin-left: -70px;
			}
			#select{
					border: 1px solid black;
				width: 300px;
				height: 200px;
				margin-top: -100px;
				margin-right: 100px;
			}
			#pf_address{
				width: 550px;
				
			}
			#pf_education,#pf_salary{
				width: 140px;
			}
			
			/*确定  返回*/
			#aj{
				margin-top: 15px;
				margin-left: 370px;
			}
			#aj #add{
				
				margin-right: 20px;
			}
			
 
         
         
		/*照片上传*/
		#result{
				border: 1px solid black;
				width: 173px;
				height: 170px;
			/*	display: block;*/
			position: absolute;
				margin-top: -90px;
				line-height: 150px;
				text-align: center;
				
				
		}
		#result img{
			width: 169px;
			height: 169px;
		}
		
		#tct{
			position: absolute;
			top:85px;
			left: 185px;
		}
		 #aj input{
				width: 60px;
				height: 25px;
					line-height:10px;
			} 
			#del input{
			width: 40px;
			}
			#dz input {
			width: 570px;
}
		#add label {
			margin-left: 10px;
}
		</style> 
		
 	</head>
	<body>
		
		<p>人事管理>人事档案管理>档案变更</p>
		<div id="zd">
		<form id="myForm" name="myForm"  method="post" action="${pageContext.request.contextPath }/change.html" enctype="multipart/form-data">
				<input  type="text" id="position_id" name="position_id" value="${List.position_id }" hidden="hidden" /><!-- 职位id -->
				<input  type="text" id="id" name="id" value="${List.id }" hidden="hidden" /><!--人事id  -->
					<input  type="text" id="pf_audit" name="pf_audit" value="${List.pf_audit }" hidden="hidden" /><!--审核状态  -->
			<table id="add" >
			<tr>
			<td><label>档案编码:</label></td>
			<td><input type="text" class="record_number" id="record_number" name="record_number" value="${List.record_number }" readonly="true">
			 </td>
			 <td>
			 		<label>变更类型:</label>
			 </td>
			 <td>
			 	<select id="pf_alteration" name="pf_alteration">
			 	<c:if test="${aList != null }">
						   <option value="0">--请选择--</option>
						   <c:forEach var="aList" items="${aList}">
						   		<option <c:if test="${aList.id == List.pf_alteration }">selected="selected"</c:if>
						   		value="${aList.id}">${aList.oalteration_type}</option>
						   </c:forEach>
						   </c:if>
			 	</select>
			 </td>
			
			</tr>
			
				<tr>
			<td><label>所属部门:</label></td>
			<td><input type="text" class="oz_name" id="oz_name" name="oz_name" value="${List.oz_name }" readonly="true">
			 </td>
			 <td>
			 		<label>档案状态:</label>
			 </td>
			 <td>
			 	<select id="pf_state" name="pf_state">
			 	<c:if test="${ftList != null }">
						   <option value="0">--请选择--</option>
						   <c:forEach var="role" items="${ftList}">
						   		<option <c:if test="${role.id == List.pf_state }">selected="selected"</c:if>
						   		value="${role.id}">${role.files}</option>
						   </c:forEach>
						   </c:if>
			 	</select>
			 </td>
			 <!--空-->
			 <td></td>
			 <td colspan="3" rowspan="5" >
		<span id="result">
			<img alt="" src="${pageContext.request.contextPath }/static/upload/${List.pf_picture}" width="173px",height="170px">
			 </span>
			 </td>
			
			</tr>
			 <tr>
			 	<td>
			 	
				<label>职位名称:</label>
    	</td>
    	<td>
		<input type="text" id="position_name" name="position_name" value="${List.position_name }" readonly="true"><span  id="tct" onclick="tc()"><img id="tt" src="${pageContext.request.contextPath }/static/img/u=2067561964,964120144&fm=26&gp=0.jpg" height="23px" width="23px" onclick="Myfile()" /></span>    	
		</td>
    	<td>
    		<label>职位编码:</label>
    	</td>
    	<td>
    		<input type="text" class="position_code" id="position_code" name="position_code" value="${List.position_code }" readonly="true">
    	</td>
    	
    	
			</tr>
			
			<tr>
			 	<td>
				<label>姓名:</label>
    	</td>
    	<td>
    		<div>
				<input type="text" id="pf_name" name="pf_name" value="${List.pf_name}">
    	 	</div>
    	</td>
    	<td>
    		<label>性别:</label>
    	</td>
    	<td>
    		<select id="pf_sex" name="pf_sex">
    	 <option value="请选择">--请选择--</option>
    				<c:choose>
    					<c:when test="${List.pf_sex=='男'}">
    						<option selected="selected" value="男" >男</option>
    						<option value="女" >女</option>
    					</c:when>
    					<c:otherwise>
    						<option  value="男" >男</option>
    						<option selected="selected" value="女" >女</option>
    					</c:otherwise>
					</c:choose>
						
						
    	</select>
    	</td>
    	
    	 <!--空-->
			  <td colspan="2"></td>
			</tr>
			
			 <tr>
			 	<td><label>E-MAIL:</label></td>
    	<td>
				<input type="email" id="pf_email" name="pf_email" value="${List.pf_email}"><!--邮箱-->
    	</td>
    	<td><label>联系电话:</label></td>
    	<td><input type="text" id="pf_phone" name="pf_phone" value="${List.pf_phone}" /> <!--电话--></td>
    	
    	 <!--空-->
			 <td colspan="2"></td>
			</tr>
			
			<tr>
				<td><label>住址:</label></td>
				<td  colspan="3" id="dz"><input type="text" id="pf_address" name="pf_address" value="${List.pf_address}"></td>
				
				 <!--空-->
			 <td colspan="2"></td>
			</tr>
			<tr>
				<td><label>身份证号:</label></td>
				<td><input type="text" id="pf_idnumber" name="pf_idnumber"  value="${List.pf_idnumber}" /></td>
				<td><label>户口所在地:</label></td>
				<td><input type="text" id="pf_residence" name="pf_residence" value="${List.pf_residence}" /></td>
				<td><label>政治面貌:</label></td>
				<td><input type="text" id="pf_politics" name="pf_politics" value="${List.pf_politics}"/></td>
			</tr>
					
			<tr>
				<td><label>毕业院校:</label></td>
				<td><input type="text" id="pf_feature" name="pf_feature" value="${List.pf_feature}" /></td>
				<td><label>专业:</label></td>
				<td><input type="text" id="pf_profession" name="pf_profession" value="${List.pf_profession}"/></td>
				<td><label>学历:</label></td>
				<td><select id="pf_education" name="pf_education">
						<c:if test="${dtList != null }">
						   <option value="0">--请选择--</option>
						   <c:forEach var="dt" items="${dtList}">
						   		<option <c:if test="${dt.id == List.pf_education }">selected="selected"</c:if>
						   		value="${dt.id}">${dt.educations}</option>
						   </c:forEach>
						   </c:if>
				</select></td>
			</tr>
			
			<tr>
				<td><label>薪酬标准:</label></td>
				<td><select id="pf_salary" name="pf_salary">
				
				
				</select></td>
				<td><label>开户行:</label></td>
				<td><input type="text" id="pf_bank" name="pf_bank" value="${List.pf_bank}"/></td>
				<td><label>银行卡号:</label></td>
				<td><input type="text" id="pf_banknumber" name="pf_banknumber" value="${List.pf_banknumber}"/></td>
			</tr>
			
			<tr>
				<td><label>社保卡号:</label></td>
				<td><input type="text" id="pf_security" name="pf_security" value="${List.pf_security}" /></td>
				<td><label>登记人:</label></td>
				<td><input type="text" id="pf_registrant" name="pf_registrant" value="${List.pf_registrant}" readonly="true"/></td>
				<td><label>建档时间:</label></td>
				<td><input type="text" id="createtime" name="createtime" readonly="true" value="<fmt:formatDate value="${List.createtime }"/>" /></td>
			</tr>
			
			<tr>
				<td><label>个人履历:</label></td>
				<td colspan="5">
				<textarea   cols="107" rows="4"  id="pf_experience" name="pf_experience"
							>${List.pf_experience}</textarea>
							</td>
				
			</tr>
				
			<tr>
				<td><label>家庭关系信息:</label></td>
				<td colspan="5"><textarea   cols="107" rows="3"  id="pf_family" name="pf_family" value="">${List.pf_family}</textarea></td>
			</tr>
			
			<tr>
				<td><label>备注:</label></td>
				<td colspan="5"><textarea   cols="107" rows="3"  id="pf_remark" name="pf_remark" value="">${List.pf_remark}</textarea></td>
			</tr>
			
			<tr  class="sc">
				<td><label>简历附件:</label></td>
				<td   class="file-box">
				<input type='file' name="pf_file" id="fujian"   />
				</td>
				<td>
			<%-- 	<span >"${pageContext.request.contextPath }/static/upload/${List.pf_accessory}"</span> --%>
				<input type="text"  value="${List.pf_accessory}"/>
				</td>
				<td id="del">
					<input  type="button"  value="删除"/>
				</td>
			</tr>
			
		<tr>
				<td><label>上传照片:</label></td>
				<td>
	<input id="pf_file" type="file" name="pf_file" accept="image/*" onchange="selectFile()" /></td>
			</tr>
			 </table>
			
			<div id="aj"> 
			<input type="hidden" id="path" name="path" value="${pageContext.request.contextPath }"/>
				<input type="submit" name="save" id="save" value="保存" />
			<input type="submit" name="check" id="check" value="变更申请"  />
					<input type="button" id="back" name="back" onclick="javascript:history.back()" value="返回" />
					</div>
			
		</form>
	<input type="hidden" id="path" name="path" value="${pageContext.request.contextPath }"/>
		</div>
	
	<script src="${pageContext.request.contextPath }/static/js/jquery-1.12.4.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/static/js/jquery.js"></script>
	 <script  src="${pageContext.request.contextPath }/static/js/personnelfile/common.js"></script>  
		<script type="text/javascript"  src="${pageContext.request.contextPath }/static/js/laydate/laydate.js"></script> 
<script  src="${pageContext.request.contextPath }/static/js/personnelfile/change.js"></script> 
	<script src="${pageContext.request.contextPath }/static/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath }/static/js/bootstrap-table.js"></script>
<script src="${pageContext.request.contextPath }/static/js/bootstrap-table-zh-CN.min.js"></script> 
	<script  src="${pageContext.request.contextPath }/static/js/personnelfile/t.js"></script> 
	<script>
	laydate.render({
			    elem:'#createtime'
			  ,calendar: true
			});
					
					/*照片上传*/
					//var files = document.getElementById('pic').files;
					var form = new FormData(); //通过HTML表单创建FormData对象
					var url = '127.0.0.1:8080/'

					function selectFile() {
						var files = document.getElementById('pf_file').files;
						console.log(files[0]);
						if(files.length == 0) {
							return;
						}
						var file = files[0];
						//把上传的图片显示出来 
						var reader = new FileReader();
						// 将文件以Data URL形式进行读入页面 
						console.log(reader);
						reader.readAsBinaryString(file);
						reader.onload = function(f) {
								var result = document.getElementById("result");
								var src = "data:" + file.type + ";base64," + window.btoa(this.result);
								result.innerHTML = '<img src ="' + src + '"/>';
							}
		 console.log('file',file); 
		 /////////////////// 
		 form.append('file',file); console.log(form.get('file')); 
					}
			</script>
	</body>
   
</html>


